import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as ex
import plotly.graph_objs as go
df = pd.read_csv('BankChurners.csv')
ex.pie(df,names='Attrition_Flag',title='Proportion of churn vs not churn customers',hole=0.33)
display(df['Customer_Age'].skew())
sns.histplot(df.Customer_Age,kde=True)
-0.033605016317173456
<AxesSubplot:xlabel='Customer_Age', ylabel='Count'>
display(df['Total_Revolving_Bal'].skew())
sns.histplot(df.Total_Revolving_Bal,kde=True)
-0.14883725028007228
<AxesSubplot:xlabel='Total_Revolving_Bal', ylabel='Count'>
display(df['Total_Trans_Ct'].skew())
sns.histplot(df.Total_Trans_Ct,kde=True)
# multimodal distribution
# may have some underlying groups in our data
0.15367306849872275
<AxesSubplot:xlabel='Total_Trans_Ct', ylabel='Count'>
sns.catplot(x="Card_Category", hue="Gender", col="Attrition_Flag",
data=df, kind="count",
height=4, aspect=.7)
<seaborn.axisgrid.FacetGrid at 0x24ec9c68df0>
sns.countplot(x=df.Total_Trans_Ct,hue=df.Attrition_Flag)
<AxesSubplot:xlabel='Total_Trans_Ct', ylabel='count'>
sns.countplot(x=df.Customer_Age,hue=df.Attrition_Flag)
<AxesSubplot:xlabel='Customer_Age', ylabel='count'>